<?php


// 搜索参数
$_GET['pid'] = empty($_GET['pid']) ? 0 : $_GET['pid'];

$oNewscat = new Newscat();
$list = null;
if(empty($_GET['pid']) && empty($_GET['depth'])){
	$newscats = cache_read('newscats.php');
	$list = $newscats['category_list'];
}
if(empty($list)){
	$list = $oNewscat->get_category_list($_GET['pid'], true, 0, 0);
}

if(!empty($list)){
	foreach($list as $key => $row){
		$row['name'] = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $row['level']).$row['name'];
		$row['url'] = PUB_DIR.'news/'.$row['mark'].'/';
		if($row['hsub'] == 1){
			$row['hsub'] = $__l['is'];
		}else{
			$row['hsub'] = '--';
		}
		$list[$key] = $row;
	}
	$vars['newscats'] = $list;
}


?>